<?php

namespace app\controllers;

use Yii;
use yii\web\Response;
use yii\base\Exception;
use app\models\Calendar;
use app\models\MemberFlow;
use app\models\SpiderContent;
use app\models\MemberFootprint;
use app\controllers\common\BaseController;

class DefaultController extends BaseController
{
  public function actionSpider()
  {
    if (Yii::$app->request->isGet) {
      Yii::$app->response->format = Response::FORMAT_JSON;
      try {
        $p = intval(Yii::$app->request->get('p', 1));

        $spider_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'flow_count', 'click_count', 'send_time']);

        $page_size = 5;
        $total_count = $spider_info->count();
        $total_page = ceil($total_count / $page_size);

        $session_member = Yii::$app->session->get('member_info');
        $flow_ids = [];
        if (isset($session_member->id)) {
          //获取用户收藏信息
          $member_flow_info = MemberFlow::find()->select(['id', 'conent_id'])->where(['member_id' => $session_member->id])->asArray()->all();
          foreach ($member_flow_info as $item) {
            array_push($flow_ids, $item['conent_id']);
          }
        }

        //获取最热的3条资讯
        $spider_hot_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'flow_count', 'click_count', 'send_time'])->where(['<>', 'cover_img', ''])->orderBy(['click_count' => SORT_DESC, 'flow_count' => SORT_DESC])->limit(3)->asArray()->all();
        if (count($flow_ids) == 0) {
          foreach ($spider_hot_info as $key => $item) {
            $spider_hot_info[$key]['is_flow'] = false;
          }
        } else {
          foreach ($spider_hot_info as $key => $item) {
            if (in_array($item['id'], $flow_ids)) {
              $spider_hot_info[$key]['is_flow'] = true;
            } else {
              $spider_hot_info[$key]['is_flow'] = false;
            }
          }
        }

        $spider_new_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'send_time'])->where(['<>', 'cover_img', ''])->orderBy(['create_time' => SORT_DESC, 'id' => SORT_DESC])->limit(3)->all();

        $list = $spider_info->offset((($p - 1) * $page_size) + 3)->orderBy(['create_time' => SORT_DESC, 'id' => SORT_DESC])->limit($page_size)->asArray()->all();
        if (count($flow_ids) == 0) {
          foreach ($list as $key => $item) {
            $list[$key]['is_flow'] = false;
          }
        } else {
          foreach ($list as $key => $item) {
            if (in_array($item['id'], $flow_ids)) {
              $list[$key]['is_flow'] = true;
            } else {
              $list[$key]['is_flow'] = false;
            }
          }
        }

        $data = ['info' => $list, 'total_page' => $total_page, 'hot_info' => $spider_hot_info, 'new_info' => $spider_new_info];
        return ['code' => 200, 'data' => $data];
      } catch (Exception $e) {
        return ['code' => -200, 'msg' => $e->getMessage()];
      }
    }
  }

  //根据类型获取数据
  public function actionGetSpiderByType(){
      Yii::$app->response->format = Response::FORMAT_JSON;
      try {
      $p = intval(Yii::$app->request->get('p', 1));
      $type= intval(Yii::$app->request->get('type', 1));
        $where = "1=1";
      if($type == 1){
        $where .= " and source = '凤凰财经'";
      }elseif($type == 2){
        $where .= " and source = '中国经济网'";
      }elseif($type == 3){
         $where .= " and source = '证券时报网' or source = '上海证券报'or source = '21世纪经济报道'";
      }else{
        $where .= " and source = '凤凰财经'";
      }
      $spider_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'flow_count', 'click_count', 'send_time'])->where($where);

      $page_size = 5;
      $total_count = $spider_info->count();
      $total_page = ceil($total_count / $page_size);

      $session_member = Yii::$app->session->get('member_info');
      $flow_ids = [];
      if (isset($session_member->id)) {
        //获取用户收藏信息
        $member_flow_info = MemberFlow::find()->select(['id', 'conent_id'])->where(['member_id' => $session_member->id])->asArray()->all();
        foreach ($member_flow_info as $item) {
          array_push($flow_ids, $item['conent_id']);
        }
      }
        //获取最热的3条资讯
        if($type == 1){
          $spider_hot_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'flow_count', 'click_count', 'send_time'])->where("cover_img != ''")->orderBy(['click_count' => SORT_DESC, 'flow_count' => SORT_DESC])->limit(3)->asArray()->all();
        }elseif($type == 2){
          $spider_hot_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'flow_count', 'click_count', 'send_time'])->where("cover_img != ''")->orderBy(['click_count' => SORT_DESC, 'flow_count' => SORT_DESC])->offset(10)->limit(3)->asArray()->all();
        }elseif($type == 3){
          $spider_hot_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'flow_count', 'click_count', 'send_time'])->where("cover_img != ''")->orderBy(['click_count' => SORT_DESC, 'flow_count' => SORT_DESC])->offset(20)->limit(3)->asArray()->all();
        }else{
          $spider_hot_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'flow_count', 'click_count', 'send_time'])->where("cover_img != ''")->orderBy(['click_count' => SORT_DESC, 'flow_count' => SORT_DESC])->limit(3)->asArray()->all();
        }


        if (count($flow_ids) == 0) {
          foreach ($spider_hot_info as $key => $item) {
            $spider_hot_info[$key]['is_flow'] = false;
          }
        } else {
          foreach ($spider_hot_info as $key => $item) {
            if (in_array($item['id'], $flow_ids)) {
              $spider_hot_info[$key]['is_flow'] = true;
            } else {
              $spider_hot_info[$key]['is_flow'] = false;
            }
          }
        }

        if($type == 1){
          $spider_new_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'send_time'])->where("cover_img != ''")->orderBy(['create_time' => SORT_DESC, 'id' => SORT_DESC])->limit(3)->all();
        }elseif($type == 2){
          $spider_new_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'send_time'])->where("cover_img != ''")->orderBy(['create_time' => SORT_DESC, 'id' => SORT_DESC])->offset(10)->limit(3)->all();
        }elseif($type == 3){
          $spider_new_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'send_time'])->where("cover_img != ''")->orderBy(['create_time' => SORT_DESC, 'id' => SORT_DESC])->offset(20)->limit(3)->all();
        }else{
          $spider_new_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'send_time'])->where("cover_img != ''")->orderBy(['create_time' => SORT_DESC, 'id' => SORT_DESC])->limit(3)->all();
        }


        $list = $spider_info->offset((($p - 1) * $page_size) + 3)->orderBy(['create_time' => SORT_DESC, 'id' => SORT_DESC])->limit($page_size)->asArray()->all();
        if (count($flow_ids) == 0) {
          foreach ($list as $key => $item) {
            $list[$key]['is_flow'] = false;
          }
        } else {
          foreach ($list as $key => $item) {
            if (in_array($item['id'], $flow_ids)) {
              $list[$key]['is_flow'] = true;
            } else {
              $list[$key]['is_flow'] = false;
            }
          }
        }

        $data = ['info' => $list, 'total_page' => $total_page, 'hot_info' => $spider_hot_info, 'new_info' => $spider_new_info];
        return ['code' => 200, 'data' => $data];
      } catch (Exception $e) {
        return ['code' => -200, 'msg' => $e->getMessage()];
      }

  }

  //根据日期获取对应的数据
  public function actionGetInfo()
  {
    if (Yii::$app->request->isPost) {
      Yii::$app->response->format = Response::FORMAT_JSON;
      try {
        $spider_id = intval(Yii::$app->request->post('id', 0));
        $member_info = Yii::$app->session->get('member_info');
        if ($spider_id) {
          $spider_info = SpiderContent::find()->where(['id' => $spider_id])->one();
          // 更新当前数据访问量
          $spider_info->click_count += 1;
          $spider_info->update(0);
          $spider_arr = SpiderContent::find()->where(['id' => $spider_id])->asArray()->one();
          if (isset($member_info->id)) {
            $member_flow = MemberFlow::find()->where(['member_id' => $member_info->id, 'conent_id' => $spider_id])->one();
            if ($member_flow) {
              $spider_arr['is_flow'] = true;
            } else {
              $spider_arr['is_flow'] = false;
            }
          } else {
            $spider_arr['is_flow'] = false;
          }
          //最新推荐
          $new_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'send_time'])->orderBy(['create_time' => SORT_DESC, 'id' => SORT_DESC])->limit(3)->all();
          $data = ['info' => $spider_arr, 'recommend_info' => $new_info];

          //判断当前用户是否登录
          if (isset($member_info->id)) {
            $member_footprint = MemberFootprint::find()->where(['member_id' => $member_info->id, 'spider_id' => $spider_id])->one();
            if (!$member_footprint->id) {
              $footprint_info = new MemberFootprint();
              $footprint_info->member_id = $member_info->id;
              $footprint_info->spider_id = $spider_id;
              $footprint_info->create_time = time();
              $footprint_info->save(0);
            }
          }
          return ['code' => 200, 'data' => $data];
        }
      } catch (Exception $e) {
        return ['code' => -200, 'msg' => $e->getMessage()];
      }
    }
  }

  public function actionSpiderList()
  {
    if (Yii::$app->request->isGet) {
      Yii::$app->response->format = Response::FORMAT_JSON;
      try {
        $spider_info = SpiderContent::find()->select(['id', 'title', 'cover_img', 'source', 'flow_count', 'click_count', 'send_time'])->orderBy(['create_time' => SORT_DESC, 'id' => SORT_DESC])->limit(5)->asArray()->all();
        $session_member = Yii::$app->session->get('member_info');
        $flow_ids = [];
        if (isset($session_member->id)) {
          //获取用户收藏信息
          $member_flow_info = MemberFlow::find()->select(['id', 'conent_id'])->where(['member_id' => $session_member->id])->asArray()->all();

          foreach ($member_flow_info as $item) {
            array_push($flow_ids, $item['conent_id']);
          }
        }
        if (empty($flow_ids)) {
          foreach ($spider_info as $key => $item) {
            $spider_info[$key]['is_flow'] = false;
          }
        } else {
          foreach ($spider_info as $key => $item) {
            if (in_array($item['id'], $flow_ids)) {
              $spider_info[$key]['is_flow'] = true;
            } else {
              $spider_info[$key]['is_flow'] = false;
            }
          }
        }
        return ['code' => 200, 'data' => $spider_info];
      } catch (Exception $e) {
        return ['code' => -200, 'msg' => $e->getMessage()];
      }
    }
  }

  /**
   * 获取日历信息
   *
   * @return void
   */
  public function actionGetCalendar()
  {
    if (Yii::$app->request->isGet) {
      Yii::$app->response->format = Response::FORMAT_JSON;
      try {
        $calendar_info = Calendar::find()->select(['date_value', 'data_name'])->orderBy(['date_unix' => SORT_ASC])->all();
        $cal_data = [];
        foreach ($calendar_info as $item) {
          $cal_data[$item['date_value']] = ['name' => $item['data_name']];
        }
        return ['code' => 200, 'data' => $cal_data];
      } catch (Exception $e) {
        return ['code' => -200, 'msg' => $e->getMessage()];
      }
    }
  }
  /**
   * 根据日期获取日历信息
   *
   * @return void
   */
  public function actionGetCalendarByDate()
  {
      Yii::$app->response->format = Response::FORMAT_JSON;
      try {
        $choose_date = intval(Yii::$app->request->post('choose_date'));
        if(empty($choose_date)){
          return ['code' => -200, 'msg' => '参数不能为空'];
        }
        $calendar_info = Calendar::find()->select(['date_value', 'data_name', 'history_today', 'marketing', 'image_url'])->where("date_value = $choose_date")->orderBy(['date_unix' => SORT_ASC])->all();

        return ['code' => 200, 'data' => $calendar_info];
      } catch (Exception $e) {
        return ['code' => -200, 'msg' => $e->getMessage()];
      }

  }
  /**
   * 获取搜索信息
   *
   * @return void
   */
  public function actionSearchInfo()
  {
    if (Yii::$app->request->isPost) {
      Yii::$app->response->format = Response::FORMAT_JSON;
      try {
        $p = intval(Yii::$app->request->post('p', 1));
        $search_title = trim(Yii::$app->request->post('title', ''));
        if (empty($search_title)) {
          throw new Exception('请输入所需要查询的内容');
        }
        $spider = SpiderContent::find()->select(['id', 'title', 'source'])->where(['LIKE', 'title', $search_title])->andWhere(['<>', 'title', ''])->orderBy(['send_time' => SORT_DESC]);
        $page_size = 10;
        $spider_count = $spider->count();
        $total_page = ceil($spider_count / $page_size);

        $spider_info = $spider->offset(($p - 1) * $page_size)->limit($page_size)->all();

        //对查询关键字进行高亮处理
        foreach ($spider_info as $item) {
          $item['title'] = str_replace($search_title, "<font color='red'>" . $search_title . '</font>', $item['title']);
        }
        $data = ['info' => $spider_info, 'count' => $spider_count, 'total_page' => $total_page];
        return ['code' => 200, 'data' => $data];
      } catch (Exception $e) {
        return ['code' => -200, 'msg' => $e->getMessage()];
      }
    }
  }

  public function actionIndex()
  {
    return $this->redirect('http://www.toujiaoview.com/toujiao/dist/index.html');
  }

  public function actionNewList()
  {
    Yii::$app->response->format = Response::FORMAT_JSON;
    try {
      if (Yii::$app->request->isGet) {
        $list = [
          ['id' => '0', 'title' => '曾与成龙齐名的打星，巅峰时消失，60岁身材壮硕像32岁', 'website' => '阿凡娱乐', 'time' => '9小时前', 'content' => '<p class="one-p">在大家心中熟知的那批功夫演员，他们付出了非常多的血汗，在小时候就已经深磨武术，比如成龙在孩儿时期已经习武，虽然拥有极佳的功夫底子，初入戏圈里也得从替身做起，因为吴思远的作品让他在圈里成为人气红火的功夫演员，他们的合作关系只是借用，尔后吴思远有意挖掘另外一位可以替代成龙，当时他的目光落在李元霸身上！</p><p class="one-p"><img class="content-picture" data-ratio="0.6666666666666666" data-type="jpeg" src="https://inews.gtimg.com/newsapp_bt/0/7317431752/1000"> </p><p class="one-p">这位幸运儿在的发展一点也没有让大家失望过，首秀作品就挑起了重挑，通过那部“龙之忍者”一举成为圈里的大名人，这部作品在多个国家受到了极大的欢迎，李元霸从而也赢得了极高声望，，也被视为新一代成龙！</p><p class="one-p"><img class="content-picture" data-ratio="0.6666666666666666" data-type="jpeg" src="https://att2.citysbs.com/hangzhou/2019/08/15/06/middle_660x435-065056_v2_14371565823056700_8601e3578f9fa889eeb14caf7b5382ab.jpg"> </p><p class="one-p">他在短时间里成为关注度极高演员，而且戏源上颇为丰富，所面临挑战的戏份人们也给予很高的评价，特别是与周润发共同主演的“老虎出更”，成为李元霸在戏圈留下的一部极为经典作品，收获了极高的票房！</p><p class="one-p"><img class="content-picture" data-ratio="0.6666666666666666" data-type="jpeg" src="https://att2.citysbs.com/hangzhou/2019/08/15/06/middle_660x413-065056_v2_20171565823056360_1bfef8084b559791f4380a74292d610e.jpg"> </p><p class="one-p">当时他们二人在影片中的默契配合，为影片塑造了非常好氛围，李元霸在影片中所展现出来的惊险场景戏，特别的夺人眼球，也赢得观众们极高评价，此部作品同样在多个国家的影片市场受到人们的追捧！</p><p class="one-p"><img class="content-picture" data-ratio="0.6666666666666666" data-type="jpeg" src="https://att2.citysbs.com/hangzhou/2019/08/15/06/middle_660x442-065055_v2_12511565823055654_7515147196d0e9b5977eee7b93a77ebb.jpg"> </p><p class="one-p">这位一出道就被大家认定可以在戏圈里大有作为的李元霸，在演艺巅峰时的他突然消失，对于他的去向更多说是为了照顾母亲，这样也就错过了在戏圈里的发展，这么长久的没有出演作品，人们也慢慢把他遗忘了！</p><p class="one-p"><img class="content-picture" data-ratio="0.6666666666666666" data-type="jpeg" src="https://att2.citysbs.com/hangzhou/2019/08/15/06/middle_660x369-065055_v2_13511565823055215_b515aa05bbb73125756990617af41106.jpg"> </p><p class="one-p">毕竟李元霸的实力非常好，如果再次到戏圈里打拼，也应该有着极好的机遇，如今60岁的他，这个身材壮硕像32岁，对于他如果再次进入到戏圈里，你们期待吗，对于他所演的作品，你还有印象吗！</p><p class="one-p"><img class="content-picture" data-ratio="0.6666666666666666" data-type="jpeg" data-src="https://mmbiz.qpic.cn/mmbiz_jpg/ibIicqTshRnougBJCZbB4rxOJeLOHic3V7GdLMdvDY74JC0nx4bPSeZrrc4pK85nwCg3EcD5xGn8ICSBjRH7XgIKw/640?wx_fmt=jpeg"> </p>'],
          ['id' => '1', 'title' => '热巴和外籍男模拍画报，同框时看清她的脸，网友：确定是本人？', 'website' => '风泉满清', 'time' => '7小时前', 'content' => '<p class="section txt" >当热巴和外国男模拍摄时尚写真的时候，真的是美到极点了，但是热巴的脸好像一个外国人啊，不怎么像中国人的脸，怪不得网友会说：没有一点中国人的象征，你们觉得呢？</p>'],
          ['id' => '2', 'title' => '复联4：绿巨人“打响指”时，大家都在防护，雷神的动作亮了', 'website' => '神的降临', 'time' => '7小时前', 'content' => '<p class="section txt" >亲爱的朋友们，大家好！小白又上线啦！今天小白想要和大家讨论的是有关于漫威电影中的内容！小白依稀还记得，《复仇者联盟4》这部电影在内地上映的时间甚至还要比北美的时间早！所以咱们成为了这部电影的第一批观众，在这部影片中，小白印象最深刻的人物就是雷神了！不仅是因为雷神成为了“肥宅”，还有很多的小细节也是非常的暖心，不知道这个细节大家注意到没有！小白记得，在这部影片中，实际上是就有两次“打响指”，除了钢铁侠</p>'],
        ];
        $imglist = [
          ['img' => Yii::$app->request->hostInfo . '/toujiao/mobile_wyzx/images/s_img1.png', 'title' => '《上海堡垒》倒下了，中国科幻元年梦碎2019'],
          ['img' => Yii::$app->request->hostInfo . '/toujiao/mobile_wyzx/images/s_img2.png', 'title' => '拯救暑期档！就看这部让你“笑到缺氧”的大娱乐片了'],
          ['img' => Yii::$app->request->hostInfo . '/toujiao/mobile_wyzx/images/s_img3.png', 'title' => '《豹》《茶花女》服装设计师去世，曾获奥斯卡终身成就奖'],
        ];
        $imgtext = [
          ['id' => '0', 'tate' => false, 'img' => Yii::$app->request->hostInfo . '/toujiao/mobile_wyzx/images/scroll_img1.png', 'title' => '《哪吒》票房“跌跌不休”，热度大减，超越《流浪地球》已没戏？', 'website' => '演的都是戏', 'time' => '3小时前', 'hotNum' => '220', 'collectNum' => '200', 'content' => '<p><span style="color: rgb(51, 51, 51); font-family: &quot;Microsoft Yahei&quot;, Simsun, Gotham-Medium, Arial; font-size: 14px;"></span></p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">这个夏天，《哪吒之魔童降世》的疯狂让所有人为之侧目。豆瓣8.6分高口碑，上映20天票房逼近38亿（接近一天两亿），成为一骑绝尘的超级大黑马。</p><p class="bjh-image-container imgbox" style="overflow-wrap: break-word;" data-bjh-caption-text="" data-bjh-caption-id="cap-640b96fb-d3e7-45cd-9300-087a2d87878b"><span class="image-box" style="display: block; margin-bottom: 20px; margin-top: 20px;"><img class="image-loaded" data-height="698" data-ratio="0.6666666666666666" data-type="png" data-width="1080" src="http://dingyue.ws.126.net/2019/08/15/c6bbff43d87f4880b452dde2c9e7affc.jpeg?imageView&thumbnail=750x0&quality=85&type=jpg&interlace=1" style="background: none 0% 0% / auto repeat scroll padding-box border-box transparent; border: 0px none currentcolor; display: block;  margin-left: auto; margin-right: auto; opacity: 1;  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); width:auto !important;max-width:100% !important;height:auto !important;"><br  /></span></p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">包括猫眼专业版在内的权威平台，纷纷预测《哪吒》票房将会超越年初的另一爆款《流浪地球》（46.54亿），独霸内地电影历史票房亚军的位置。</p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">但关注《哪吒》票房的朋友会发现，最近也开始“跌跌不休”了。</p><p class="bjh-image-container imgbox" style="overflow-wrap: break-word;" data-bjh-caption-text="" data-bjh-caption-id="cap-ea47cc3e-6e85-45cf-a4ae-bc831db4db82"><span class="image-box" style="display: block; margin-bottom: 20px; margin-top: 20px;"><img data-height="857" data-ratio="0.6666666666666666" data-type="png" data-width="1080" src="http://dingyue.ws.126.net/2019/08/15/a26a7e1caabb405e857b865d72b8424e.jpeg?imageView&thumbnail=750x0&quality=85&type=jpg&interlace=1" style="border: 0px none currentcolor; display: block;  margin-left: auto; margin-right: auto;  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); width:auto !important;max-width:100% !important;height:auto !important;"><br  /></span></p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">8月12日是一个分水岭，从这天起，《哪吒》票房结束了连续17天破亿的历史。随后一路走低：8900万、7800万、6800万，对于志在超越《流浪地球》的国漫神作来说，这不是一个好信号。</p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">接下来的这个周末是个关键，《哪吒》能否逆势反弹，重回单日破亿的风光，会直接决定这场“战争”的输赢。</p><p class="bjh-image-container imgbox" style="overflow-wrap: break-word;" data-bjh-caption-text="" data-bjh-caption-id="cap-85a6810a-6ec7-41d5-956a-befbc161d1f3"><span class="image-box" style="display: block; margin-bottom: 20px; margin-top: 20px;"><img data-height="670" data-ratio="0.6666666666666666" data-type="png" data-width="1080" src="http://dingyue.ws.126.net/2019/08/15/0604371eae594111a1a362920b32b81d.jpeg?imageView&thumbnail=750x0&quality=85&type=jpg&interlace=1" style="border: 0px none currentcolor; display: block;  margin-left: auto; margin-right: auto;  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); width:auto !important;max-width:100% !important;height:auto !important;"><br  /></span></p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">站在吃瓜群众的角度，当然希望看到《哪吒》能搞定一切。但如果理性一点，不管《哪吒》票房能走到哪一个地步，今天的局面已经是大获成功了。</p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">先算一笔账，以《哪吒》总票房45亿（这个数据基本靠谱）为准，则分账票房至少有42亿。</p><p class="bjh-image-container imgbox" style="overflow-wrap: break-word;" data-bjh-caption-text="" data-bjh-caption-id="cap-1bed142d-d7f3-4cee-885a-b790e53a336c"><span class="image-box" style="display: block; margin-bottom: 20px; margin-top: 20px;"><img data-height="516" data-ratio="0.6666666666666666" data-type="jpeg" data-width="1080" src="http://dingyue.ws.126.net/2019/08/15/8836cbc3a3ff40be9ad5f58b52f9bce6.jpeg?imageView&thumbnail=750x0&quality=85&type=jpg&interlace=1" style="border: 0px none currentcolor; display: block;  margin-left: auto; margin-right: auto;  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); width:auto !important;max-width:100% !important;height:auto !important;"><br  /></span></p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">以片方占40%计算，收入达到了惊人的16.8亿。</p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">那么，《哪吒》的成本是多少呢？目前市面上对此依然保持沉默，但从超过80%的特效占比来看，其烧钱程度肉眼可见。</p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">有一种说法是不低于1亿。小编的看法，大概是2亿左右——因为没有演员片酬，动画片的成本控制还是相对容易的。</p><p class="bjh-image-container imgbox" style="overflow-wrap: break-word;" data-bjh-caption-text="" data-bjh-caption-id="cap-f23f2149-1cdf-4843-bddd-65e29bfbd0ef"><span class="image-box" style="display: block; margin-bottom: 20px; margin-top: 20px;"><img data-height="1073" data-ratio="0.6666666666666666" data-type="png" data-width="1080" data-src="https://mmbiz.qpic.cn/mmbiz_png/TW2xJWZpfc4gPLObuJk9KTpVV3Dp928iczfSrEDBIdgBrOnTKWVAZyyloefzo9gBBAOc2pwJAVUqJlTmpfpFatQ/640?wx_fmt=png" style="border: 0px none currentcolor; display: block;  margin-left: auto; margin-right: auto;  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); width:auto !important;max-width:100% !important;height:auto !important;"><br  /></span></p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">如果是2亿，那将意味着毛利直逼14.8亿，超过了《流浪地球》。</p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">对这个投资巨赚的实例，电影制作和投资人们是不是应该好好反思反思了。</p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">以后还有没有人投资流量鲜肉为牌面的烂片（比如《上海堡垒》），不好说，但加大国漫扶持力度，算不算一个极好的趋势呢？</p><p class="bjh-image-container imgbox" style="overflow-wrap: break-word;" data-bjh-caption-text="" data-bjh-caption-id="cap-4d7d3615-b3d8-477a-8e9d-023ca95d5a3e"><span class="image-box" style="display: block; margin-bottom: 20px; margin-top: 20px;"><img data-height="1254" data-ratio="0.6666666666666666" data-type="png" data-width="1080" src="http://dingyue.ws.126.net/2019/08/15/4f11c2bc33b34bea8fbad624414b420c.jpeg?imageView&thumbnail=750x0&quality=85&type=jpg&interlace=1" style="border: 0px none currentcolor; display: block;  margin-left: auto; margin-right: auto;  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); width:auto !important;max-width:100% !important;height:auto !important;"><br  /></span></p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">《哪吒》的成功，等于宣布中国电影人完全可以打造大受欢迎的国漫动画。如果各种扶持到位，编剧更走心一些，还能做出比《哪吒》更牛X的作品。</p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">一直默默耕耘，孤独押宝国漫的光线影业，如今也获得了丰厚回报，不仅直接进账超10亿，股价更是扶摇直上暴涨50亿，市值是昔日王者华谊的两倍！</p><p class="bjh-image-container imgbox" style="overflow-wrap: break-word;" data-bjh-caption-text="" data-bjh-caption-id="cap-30d22d85-a17e-4877-954d-19615519c48e"><span class="image-box" style="display: block; margin-bottom: 20px; margin-top: 20px;"><img data-height="1080" data-ratio="0.6666666666666666" data-type="jpeg" data-width="1458" src="http://dingyue.ws.126.net/2019/08/15/e17c97bbc85244dabe7a2915b7f8d578.jpeg?imageView&thumbnail=750x0&quality=85&type=jpg&interlace=1" style="border: 0px none currentcolor; display: block;  margin-left: auto; margin-right: auto;  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); width:auto !important;max-width:100% !important;height:auto !important;"><br  /></span></p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">相比票房上的风光，《哪吒》成功的更深层意义，在于将会大大推进国产动漫的结构布局。</p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">以后，动画将不再是《熊出没》这种低幼作品的天下，而是更吸引成年观众的《大圣归来》和《哪吒》。</p><p style="margin-bottom: 20px; margin-top: 20px; overflow-wrap: break-word;">能不能超过《流浪地球》票房，并不重要。是不是“国漫之光”，也不重要。关键是现象级的作品能影响观众的观影习惯，为国漫产业创造更佳发展条件。</p><p class="bjh-image-container imgbox" style="overflow-wrap: break-word;" data-bjh-caption-text="" data-bjh-caption-id="cap-e62048f4-041f-4795-b8a2-e6ec244bac07"><span class="image-box" style="display: block; margin-bottom: 20px; margin-top: 20px;"><img data-height="607" data-ratio="0.6666666666666666" data-type="jpeg" data-width="1080" src="http://dingyue.ws.126.net/2019/08/15/0d71fbe9e637423c8bbf4d9efe163cd8.jpeg?imageView&thumbnail=750x0&quality=85&type=jpg&interlace=1" style="border: 0px none currentcolor; display: block;  margin-left: auto; margin-right: auto;  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); width:auto !important;max-width:100% !important;height:auto !important;"></span></p><p><br  /></p>'],
          ['id' => '1', 'tate' => false, 'img' => Yii::$app->request->hostInfo . '/toujiao/mobile_wyzx/images/scroll_img2.png', 'title' => '《上海堡垒》团队挨个出来道歉，观众最不满意的是这点 ', 'website' => '追剧社', 'time' => '4小时前', 'hotNum' => '220', 'collectNum' => '200', 'content' => '<p><br  /></p><p style="line-height: 2em;letter-spacing: 1px;"><img class="" data-ratio="0.3333333333333333" src="//5b0988e595225.cdn.sohucs.com/q_70,c_zoom,w_640/images/20190815/2359a015f40e49e5a6bca3d7168ac2f2.jpeg" data-type="gif" data-w="600"></p><p style="line-height: 2em;letter-spacing: 1px;"><br  /></p><p style="line-height: 2em;letter-spacing: 1px;"><span style="font-size: 15px;color: rgb(136, 136, 136);">8月9日，由鹿晗、舒淇主演的科幻电影《上海堡垒》上映，但口碑、票房均不尽人意。</span><span style="font-size: 15px;color: rgb(136, 136, 136);">截至发稿，该片豆瓣评分已降至3.2分，六成多的用户打出了一分的成绩。</span></p><p style="line-height: 2em;letter-spacing: 1px;"><span style="font-size: 15px;color: rgb(136, 136, 136);"><br  /></span></p><p style="line-height: 2em;letter-spacing: 1px;"><img class="rich_pages" data-croporisrc="https://mmbiz.qlogo.cn/mmbiz_png/kic7aRVFETmKkDbb1hvwH99AuyMbkK3vWLLF2v2vicXlRE7gxEhbEEoj0HO1db62XiaCZeOp3icR0iaQokniam6X0ksg/?wx_fmt=png" data-cropx1="0" data-cropx2="661.4529616724739" data-cropy1="19.818815331010452" data-cropy2="286.1341463414634" data-ratio="0.40242057488653554" data-s="300,640" src="https://5b0988e595225.cdn.sohucs.com/q_70,c_zoom,w_640/images/20190815/1c7f4ad6ab1b4afdabb1b9829eaf454e.jpeg" data-type="jpeg" data-w="661" style="width: 534px;height: 215px;"></p><p style="line-height: 2em;letter-spacing: 1px;"><br  /></p><p style="line-height: 2em;letter-spacing: 1px;"><span style="font-size: 15px;color: rgb(136, 136, 136);">有网友评论说《流浪地球》打开了中国科幻的一扇门，《上海堡垒》又给关上了。</span><span style="font-size: 15px;color: rgb(136, 136, 136);">这句话令导演感到很心痛，于是在微博发文道歉说：</span><span style="font-size: 15px;color: rgb(136, 136, 136);">真的很抱歉，因为我相信，没有人想要去关上这扇闪着光的门。</span><span style="font-size: 15px;color: rgb(136, 136, 136);">我作为导演，没有带着大家在这条路上走更远，但我知道，每一个人都在努力向前。</span></p><p style="line-height: 2em;letter-spacing: 1px;"><span style="font-size: 15px;color: rgb(136, 136, 136);">随后《上海堡垒》的原著作者江南也转发微博致歉，说辜负了观众的期待。</span></p><p style="line-height: 2em;letter-spacing: 1px;"><span style="font-size: 15px;color: rgb(136, 136, 136);"><br  /></span></p><p style="text-align: center;"><img class="rich_pages" data-ratio="0.41939890710382516" data-s="300,640" src="https://5b0988e595225.cdn.sohucs.com/q_70,c_zoom,w_640/images/20190815/7d52560338c546659ff1e71fc0ade2f4.jpeg" data-type="png" data-w="732" style=""></p><p style="line-height: 2em;letter-spacing: 1px;"><span style="font-size: 15px;color: rgb(136, 136, 136);"><br  /></span></p><p style="line-height: 2em;letter-spacing: 1px;"><span style="font-size: 15px;color: rgb(136, 136, 136);">其实对于《上海堡垒》票房、口碑双双扑街，很多人说，最不该的是用流量演员。难道，鹿晗该背这个锅吗？</span><span style="font-size: 15px;color: rgb(136, 136, 136);">其实在一组投票的数据中显示并非如此。</span><span style="font-size: 15px;color: rgb(136, 136, 136);">票房不太行更多人认为是，剧情差，披着科幻的皮。</span></p><p style="line-height: 2em;letter-spacing: 1px;"><span style="font-size: 15px;color: rgb(136, 136, 136);"><br  /></span></p><p style="text-align: center;"><img class="rich_pages" data-ratio="0.5709219858156028" data-s="300,640" src="https://5b0988e595225.cdn.sohucs.com/q_70,c_zoom,w_640/images/20190815/a8c6c98b1dd4403f80821cc48400180c.webp" data-type="png" data-w="564" style=""></p><p style="line-height: 2em;letter-spacing: 1px;"><br  /></p><p style="line-height: 2em;letter-spacing: 1px;"><span style="font-size: 15px;color: rgb(136, 136, 136);">而很多人表示，在这部剧里，鹿晗的表现还不错。</span><span style="font-size: 15px;color: rgb(136, 136, 136);">在宣传工作时，也是兢兢业业地跟着剧组在各个城市路演。</span><span style="font-size: 15px;color: rgb(136, 136, 136);">其实我们可以看出来，鹿晗的竞争力越来越差。</span><span style="font-size: 15px;color: rgb(136, 136, 136);">在《向往的生活》中，黄磊问导演为什么选择鹿晗的时候，导演也只是说因为长相。</span><span style="font-size: 15px;color: rgb(136, 136, 136);">（其实很大原因大概就是因为流量）。</span></p><p style="line-height: 2em;letter-spacing: 1px;"><span style="font-size: 15px;color: rgb(136, 136, 136);"><br  /></span></p><p><img class="" data-ratio="0.5625" src="https://5b0988e595225.cdn.sohucs.com/q_70,c_zoom,w_640/images/20190815/dd7738cfc7aa41ceb6d35d9ad28ea51b.webp" data-type="jpeg" data-w="1024"></p><p class="pgc-img-caption"><br  /></p><p style="line-height: 2em;letter-spacing: 1px;"><span style="font-size: 15px;color: rgb(136, 136, 136);">有一大份人认为，豆瓣的网友对主演鹿晗存在着“<span style="color: rgb(136, 136, 136);font-size: 15px;letter-spacing: 1px;">流量偏见</span>”，有恶意低分的质疑。</span><span style="font-size: 15px;color: rgb(136, 136, 136);">但是剧情差真的是硬伤，无从说起。</span><span style="font-size: 15px;color: rgb(136, 136, 136);">虽说电影题材是科幻片，但却神似偶像剧，里面有大量爱情戏。</span></p><p style="line-height: 2em;letter-spacing: 1px;"><span style="font-size: 15px;color: rgb(136, 136, 136);"><br  /></span></p><p><img class="" data-ratio="0.5625" src="https://5b0988e595225.cdn.sohucs.com/q_70,c_zoom,w_640/images/20190815/87dbdf60ea7e4a85b3c17c889e220853.webp" data-type="jpeg" data-w="1024"></p><p class="pgc-img-caption"><br  /></p><p style="line-height: 2em;letter-spacing: 1px;"><span style="font-size: 15px;color: rgb(136, 136, 136);">其实科幻片对于中国电影而言，还处于初级发展阶段，观众能叫得上名字的国产科幻片屈指可数。</span><span style="font-size: 15px;color: rgb(136, 136, 136);">而《流浪地球》的大爆，也是因为剧本本身逻辑情节无可挑剔。</span><span style="font-size: 15px;color: rgb(136, 136, 136);">所以《上海堡垒》的扑街，也说明中国科幻电影的路还有很长要走。</span></p><p><br  /></p><p style="line-height: 2em;letter-spacing: 1px;"><img class="" data-ratio="0.034482758620689655" data-src="https://mmbiz.qpic.cn/mmbiz_gif/kic7aRVFETmJkVfxKKn1enkAJ070dpKnA99hodqctm36SewzgAQ2BJqRI46xicSFOTRtl8F6IYGiaXy3n6dYoC04A/640?wx_fmt=gif" data-type="gif" data-w="580"></p><p style="line-height: 2em;letter-spacing: 1px;"><img class="" data-ratio="0.3458333333333333" data-src="https://mmbiz.qpic.cn/mmbiz_png/kic7aRVFETmLTnbGYlQibuGxRiaDvXznXNYiaibOMa4I6VPtclJfKBLDNln8phgnso4UP4dibegzVe468iboEGdFibLz9w/640?wx_fmt=png" data-type="png" data-w="720"></p>'],
          ['id' => '2', 'tate' => false, 'img' => Yii::$app->request->hostInfo . '/toujiao/mobile_wyzx/images/scroll_img3.png', 'title' => '导演当男主，女主零片酬，却创造经典！网友：上海堡垒哭晕在厕所', 'website' => '小哪吒的娱乐圈', 'time' => '3小时前', 'hotNum' => '220', 'collectNum' => '200', 'content' => '<p class="section txt" >哈喽大家好，你们可爱的小编又回来了！今天小编跟大家聊一下小编最近看的一部电影，一部关注骑行西藏穿越无人区的电影，现在的电影很多都是大制作，但大家有没有发现，很多大制作的电影，出来的往往不尽人意，而那些小制作的电影，却让人好评不断！</p>'],
          ['id' => '3', 'tate' => false, 'img' => Yii::$app->request->hostInfo . '/toujiao/mobile_wyzx/images/scroll_img4.png', 'title' => '亮剑有多真实？李云龙的衣领赵刚的茶缸不算什么，你看孔捷抽的啥', 'website' => '军话', 'time' => '5小时前', 'hotNum' => '220', 'collectNum' => '200', 'content' => '<p class="section txt">《亮剑》是一部军事题材的电视连续剧，是根据都梁的同名小说改编，由张前，陈健导演，李幼斌、童蕾、何政军、张光北等演员主演，它主要描写了我国抗日战争、解放战争期间八路军129师独立团团长李云龙带兵打仗的故事，为我们塑造了一个极具个性色彩的有血有肉的军人的故事。</p>'],
        ];
        $return_data = ['topList' => $list, 'imgList' => $imglist, 'imgText' => $imgtext];
        return ['code' => 200, 'data' => $return_data];
      }
    } catch (Exception $e) {
      return ['code' => $e->getCode(), 'msg' => $e->getMessage()];
    }
  }
}
